import json

def response(flow):
    if '/s/net/wisers/wisesearch6/G.https/wevo/api' in flow.request.url:
        for content in json.loads(flow.response.text)['g0']['data']['data']['items']:
            try:
                content_info = {}
                content_info['title'] = content['headline']
                content_info['date'] = content['publishDate']
                content_info['link'] = 'https://ersp.lib.whu.edu.cn/s/net/wisers/wisesearch6/G.https/wevo/documentDetail/' + content['docId']
                print(content_info)
                with open('content_info.txt', 'a', encoding='utf-8')as f:
                    f.write(json.dumps(content_info, ensure_ascii=False))
                    f.write('\n')
            except:
                pass

